<template>
    <div>
        <ul class="nav" v-if="isNav">
            <li v-for="item in routes" :key="item.path">
                <router-link :exact="item.isExact" :to="item.path">
                    {{ item.title }}
                </router-link>
            </li>
        </ul>
        <router-view name="nav"></router-view>
    </div>
</template>

<script>
import { routes } from '@/router'
export default {
    data() {
        return {}
    },
    computed: {
        routes() {
            return routes.filter((item) => !item.hidden)
        },
        isNav() {
            return this.$route.meta.isNav
        },
    },
}
</script>

<style>
* {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
}

.nav {
    position: fixed;
    left: 0;
    bottom: 0;
    border-top: 1px solid #999;
    width: 100vw;
    display: flex;
    padding: 10px 0;
    background: #fff;
    box-sizing: border-box;
}
.nav li {
    flex: 1;
    text-align: center;
}
.nav li a {
    color: #787878;
}

/* .nav li a.router-link-active {
  color: red;
} */
.nav li a.router-link-active {
    color: red;
}
</style>
